﻿using Engine;
using Engine.Graphics;
using Game;
namespace Mekiasm
{
    public class ItemCube : Item
    {
        public ItemCube(string displayName_) : base(displayName_)
        {
        }
        
        public override bool OnUse(Ray3 aim, ComponentMiner componentMiner, TerrainRaycastResult? raycast)
        {
            return false;
        }
        
        public override void DrawBlock(PrimitivesRenderer3D primitivesRenderer, int value, Color color, float size, ref Matrix matrix, DrawBlockEnvironmentData environmentData)
        {
            ILibrary.DrawCubeBlock(primitivesRenderer, value, new Vector3(size), ref matrix, Color.White, Color.White, environmentData);
        }

        public override int GetFaceTextureSlot(int face, int value)
        {
            return itemIndex;
        }

        public override void GenerateTerrainVertices(Block block, BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z)
        {
            SubsystemMekBlockBehavior.mekModelGenerator.GenerateCubeVerticesBase(block, value, x, y, z, Color.White, geometry.GetGeometry(ILibrary.texture).OpaqueSubsetsByFace);
        }

        public override BlockDigMethod GetDigMethod(int value)
        {
            return BlockDigMethod.Quarry;
        }

        public override float GetDigResilience(int value)
        {
            return 6f;
        }
    }
}
